Optimal. Leaf size=52 \[ -\frac{a \cot ^3(c+d x)}{3 d}+\frac{a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a \cot (c+d x) \csc (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.108351, antiderivative size = 52, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.185, Rules used = {2838, 2607, 30, 2611, 3770} \[ -\frac{a \cot ^3(c+d x)}{3 d}+\frac{a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a \cot (c+d x) \csc (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2838
Rule 2607
Rule 30
Rule 2611
Rule 3770
Rubi steps
\begin{align*} \int \cot ^2(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx &=a \int \cot ^2(c+d x) \csc (c+d x) \, dx+a \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx\\ &=-\frac{a \cot (c+d x) \csc (c+d x)}{2 d}-\frac{1}{2} a \int \csc (c+d x) \, dx+\frac{a \operatorname{Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}\\ &=\frac{a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a \cot ^3(c+d x)}{3 d}-\frac{a \cot (c+d x) \csc (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.0379738, size = 95, normalized size = 1.83 \[ -\frac{a \cot ^3(c+d x)}{3 d}-\frac{a \csc ^2\left (\frac{1}{2} (c+d x)\right )}{8 d}+\frac{a \sec ^2\left (\frac{1}{2} (c+d x)\right )}{8 d}-\frac{a \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{2 d}+\frac{a \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.053, size = 80, normalized size = 1.5 \begin{align*} -{\frac{a \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{2\,d \left ( \sin \left ( dx+c \right ) \right ) ^{2}}}-{\frac{\cos \left ( dx+c \right ) a}{2\,d}}-{\frac{a\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{2\,d}}-{\frac{a \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{3\,d \left ( \sin \left ( dx+c \right ) \right ) ^{3}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.05787, size = 82, normalized size = 1.58 \begin{align*} \frac{3 \, a{\left (\frac{2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - \frac{4 \, a}{\tan \left (d x + c\right )^{3}}}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.64813, size = 316, normalized size = 6.08 \begin{align*} \frac{4 \, a \cos \left (d x + c\right )^{3} + 6 \, a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \,{\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - 3 \,{\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right )}{12 \,{\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.35528, size = 155, normalized size = 2.98 \begin{align*} \frac{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 12 \, a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + \frac{22 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3}}}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]